package jehc.cloud.gen.service.impl;

import jehc.cloud.common.base.BaseService;
import jehc.cloud.common.util.ExceptionUtil;
import jehc.cloud.gen.dao.XtDbinfoDao;
import jehc.cloud.gen.model.XtDbinfo;
import jehc.cloud.gen.dao.XtDbinfoDao;
import jehc.cloud.gen.model.XtDbinfo;
import jehc.cloud.gen.service.XtDbinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
/**
 * @Desc 数据库信息
 * @Author 邓纯杰
 * @CreateTime 2012-12-12 12:12:12
 */
@Service("xtDbinfoService")
public class XtDbinfoServiceImpl extends BaseService implements XtDbinfoService {
	@Autowired
	private XtDbinfoDao xtDbinfoDao;
	/**
	* 分页
	* @param condition 
	* @return
	*/
	public List<XtDbinfo> getXtDbinfoListByCondition(Map<String,Object> condition){
		try {
			return xtDbinfoDao.getXtDbinfoListByCondition(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}
	/**
	* 查询对象
	* @param xt_dbinfo_id 
	* @return
	*/
	public XtDbinfo getXtDbinfoById(String xt_dbinfo_id){
		try {
			return xtDbinfoDao.getXtDbinfoById(xt_dbinfo_id);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}
	/**
	* 添加
	* @param xtDbinfo
	* @return
	*/
	public int addXtDbinfo(XtDbinfo xtDbinfo){
		int i = 0;
		try {
			i = xtDbinfoDao.addXtDbinfo(xtDbinfo);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
	/**
	* 修改
	* @param xtDbinfo
	* @return
	*/
	public int updateXtDbinfo(XtDbinfo xtDbinfo){
		int i = 0;
		try {
			i = xtDbinfoDao.updateXtDbinfo(xtDbinfo);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
	/**
	* 删除
	* @param condition 
	* @return
	*/
	public int delXtDbinfo(Map<String,Object> condition){
		int i = 0;
		try {
			i = xtDbinfoDao.delXtDbinfo(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
}
